package com.cysyz.web.action

import com.cysyz.entity.product.Brand
import com.cysyz.service.product.impl.BrandService
import javax.annotation.Resource
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import org.apache.struts.action.Action
import org.apache.struts.action.ActionForm
import org.apache.struts.action.ActionMapping
import org.springframework.stereotype.Controller
import com.cysyz.web.form.BrandForm

@Controller("/contorl/brand/list")
class BrandAction extends Action{
	@Resource BrandService brandService
	override execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		var brandForm = form as BrandForm
		var brand = new Brand
		request.setAttribute("pageResult", brandService.list(brand, brandForm.page, 12))		
		mapping.findForward("list");
	}
	
}